#!/usr/bin/python3
import time


class Student(object):
    count = 0

    def __init__(self, name):
        Student.count += 1
        self.name = name


def metric(fn):
    def runFn(*argv, **kargs):
        start_time = time.process_time_ns()
        ret = fn(*argv, **kargs)
        end_time = time.process_time_ns()
        print('耗时：{:.4f}s'.format((end_time - start_time) / 1000000))
        return ret
    return runFn


@metric
def fib(max):
    arr = []
    for i in range(max):
        if (i < 2):
            arr.append(1)
        else:
            arr.append(arr[i - 1] + arr[i - 2])
    return arr.pop()


if __name__ == "__main__":
    print(fib(20))
    Student("Toby")
    Student("Tecty")
    print(Student.count)
